package cn.edu.ldk.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

//配置类
@Configuration//标记为配置类
public class RestTemplateConfig {
    @Bean
    @LoadBalanced //使用负载均衡策略，Ribbon 默认是使用轮询策略
    public RestTemplate getRestTemplateBean(){
        return new RestTemplate();
    }
}
